﻿namespace Megaplan.API
{
    using System;
    using System.Linq;
    using System.Security.Cryptography;
    using System.Text;

    public class Md5
    {
        public static string GetMd5Hash(string input)
        {
            var cryptoServiceProvider = new MD5CryptoServiceProvider();
            byte[] encriptedBytes = cryptoServiceProvider.ComputeHash(Encoding.UTF8.GetBytes(input));
            return encriptedBytes.Aggregate("", (s, e) => s + String.Format("{0:x2}", e), s => s);
        }
    }
}